fix: opening suggestion menu in collab mode on empty document#2338
fix: opening suggestion menu in collab mode on empty document#2338
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
|
On an empty document, y-prosemirror will choose to not initialize the Y.XmlFragment with content until it actually has content to sync (AKA different from a So, what we would do to fix this is to treat position tracking on an empty Y.XmlFragment ( This is probably a little tricky to implement since a number of things can happen between a position is tracked and it is actually used. In the next version of y-prosemirror, it will offer a util similar to track position (probably implemented as a position mapper). |
There's a bug that hitting the + button doesn't work in collaboration mode, on an empty document. I tried to address it here but didn't get to the root cause yet.
In this PR, I have:
However, this doesn't fix the issue yet. I think there's an issue with using
trackPositionin this specific case.We can diagnose further by adding a breakpoint in the if-statement marked by
// Checks if the menu should be hidden.